
<?php include_once 'common/header.php';  ?>
<!-- admin_main -->
<div class="admin_main">
	<!-- Admin_top end -->
	<?php include_once 'common/shop_left.php';  ?>
	<!-- Admin_Left End -->
	<div class="admin_right">
		<div class="admin_right_title">
			<strong>商城管理</strong> &gt;&gt;  公告滚动图片列表
		</div>
		
		<div class="admin_right_con">
			<a  href="/ychadmin/shop/add_scrollpic/" class="addtr">添加滚动图片</a>
			<table border="0" cellspacing="1" cellpadding="0">
			  <tr style="color:#0068b7;">
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>编号</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>URL</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>标题</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>图片</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>顺序</strong></td>
				<td height="35" align="center" valign="middle" bgcolor="#F1F1F1"><strong>操作</strong></td>
			  </tr>
			  <?php foreach($scrollpic_list as $key=>$scrollpic){?>
			  <tr id="row_<?php echo $scrollpic['id'];?>">
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $scrollpic['id'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $scrollpic['url'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $scrollpic['title'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
				<img src="<?php echo SCROLLPIC_IMG.$scrollpic['pic'];?>" width="100" height="33"  />
			  	</td>
			  	<td height="35" align="center" valign="middle" bgcolor="#FFFFFF"><?php echo $scrollpic['forder'];?></td>
				<td height="35" align="center" valign="middle" bgcolor="#FFFFFF">
				<a href="/ychadmin/shop/edit_scrollpic/<?php echo $scrollpic['id'];?>" target="_blank">编辑</a>
				<a href="javascript:if(confirm('确定删除滚动图片？')){remove(<?php echo $scrollpic['id'];?>);}">删除</a>
				</td>
			  </tr>
			  <?php }?>
			</table>
			</div>
	</div>
<!-- Admin_Right End -->
</div>
<!-- admin_main end -->
<script>
function remove(id){
	$.ajax({
		type: "post",
		url: "/ychadmin/shop/remove_scrollpic/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
</body>
</html>
